<?php

namespace app\validate;

use core\validate\Validate;

class Student extends Validate
{
    protected $rule = [
        'name'  => 'between:5,120|max:1|min:244|email|require|number',
        'age'   => 'number|between:888,999',
//        'email' => 'email',
    ];

    protected $message = [
        'name.require' => '名称不能为空',
        'name.max'     => '名称最多不能超过25个字符',
        'name.email'     => '名称不是邮箱格式',
        'name.max'     => '名称太长了',
        'name.between'     => '名称没在范围里',
        'name.number'     => '名称必须是数字',
//        'age.number'   => '年龄必须是数字',
        'age.between'  => '年龄必须在888~999之间',
//        'email'        => '邮箱格式错误',
    ];

    protected $scene = [
        'edit' => ['age'],
        'add' => ['name', 'age']
    ];
}